/*

    DLStarRating
    Copyright (C) 2011 David Linsin <dlinsin@gmail.com> 

    All rights reserved. This program and the accompanying materials
    are made available under the terms of the Eclipse Public License v1.0
    which accompanies this distribution, and is available at
    http://www.eclipse.org/legal/epl-v10.html

 */

#import <UIKit/UIKit.h>
#import "UIColor+SAMAdditions.h"
#define kDefaultNumberOfStars 5
#define kNumberOfFractions 10

@protocol DLStarRatingDelegate;

@interface DLStarRatingControl : UIControl {
	int numberOfStars;
	int currentIdx;
    float lastRating;
}

- (id)initWithFrame:(CGRect)frame;
- (id)initWithFrame:(CGRect)frame andStars:(NSUInteger)_numberOfStars isFractional:(BOOL)isFract;

@property (retain, nonatomic) UIImage *star;
@property (retain, nonatomic) UIImage *highlightedStar;
@property (retain, nonatomic) UIColor *labelTextColor;;
@property (nonatomic, assign) float rating;
@property (nonatomic, assign) id<DLStarRatingDelegate> delegate;
@property (nonatomic, assign) BOOL isFractionalRatingEnabled;
@property (nonatomic, assign) int gap;
@property (nonatomic, assign) BOOL isShowLabel;

-(UILabel *)labelIn:(int) position;
- (float)maxRating;

@end

@protocol DLStarRatingDelegate

/**正在拖动选中的*/
-(void)onRatingChange:(DLStarRatingControl *)sender :(float)ratingValue;

@end
